<script>
	import Vue from 'vue';
	export default {
		onLaunch: function() {
			switch (uni.getSystemInfoSync().platform) {
				case 'android':
					console.log("安卓")
					break;
				case 'ios':
					console.log('运行iOS上')
					let that = this;
					wx.getSystemInfo({
						success: res => {
							if (res.safeArea.top > 20) {
								that.globalData.needAdapt = false
							}else{
								that.globalData.needAdapt = true
							}
						}
					})
					break;
				default:
					console.log('运行在开发者工具上')
					// let that = this;
					// wx.getSystemInfo({
					// 	success: res => {
					// 		if (res.safeArea.top > 20) {
					// 			that.globalData.needAdapt = false
					// 		}else{
					// 			that.globalData.needAdapt = true
					// 		}
					// 	}
					// })
					break;
			}

			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					}
					// #endif
					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif
					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			});
		},
		onShow: function() {},
		onHide: function() {}
	}
</script>

<style lang="scss">
	/* #ifndef APP-PLUS-NVUE */
	/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
	@import './common/uni.css';

	@import 'colorui/main.css';
	@import 'colorui/icon.css';
	@import './common/common.scss';

	/*每个页面公共css */
	.blue_green {
		background-color: #07ABCE;
	}

	.yellow_bg {
		background-color: #FFB600;
	}

	.red_bg {
		background-color: #F0594E;
	}

	.red_text {
		color: #F0594E;
	}

	.text_blue {
		color: #06A9CB;
	}


	.box_shadow {
		box-shadow: 0 0 20upx 0 rgba(6, 117, 98, 0.35);
	}

	textarea {
		z-index: 1;
	}
</style>
